package com.melon;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * MyCommandLineRunner.
 * Author: Xiong Jin Teng
 * Date: 2016/9/14
 * Time: 9:05
 */
@Component
//@Order(value=2)
//Spring Boot应用程序在启动后，会遍历CommandLineRunner接口的实例并运行它们的run方法。
// 也可以利用@Order注解（或者实现Order接口）来规定所有CommandLineRunner实例的运行顺序。
public class MyCommandLineRunner implements CommandLineRunner {
    private static final Logger LOGGER = LoggerFactory.getLogger(MyCommandLineRunner.class);

    /**
     * Callback used to run the bean.
     *
     * @param args incoming main method arguments
     * @throws Exception on error
     */
    @Override
    public void run(String... args) throws Exception {
        LOGGER.debug(">>>>>>>>>>>>>>>服务启动执行，执行加载数据等操作<<<<<<<<<<<<<");
    }
}
